FROM php:7.3-apache
MAINTAINER Eric Zhou <eric.zhou@yamibuy.com>

ENV APACHE_DOCUMENT_ROOT /var/www/html/public
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf


WORKDIR /var/www/html/
COPY . /var/www/html/

RUN chown www-data:www-data /var/www/html/ -R
# RUN chmod +x tasks/docker-compile.sh

# USER www-data:www-data

# 对其他容器开放端口
EXPOSE 8123/tcp

# CMD  [ "tasks/docker-compile.sh" ]



# build docker 镜像
# docker build -t yamibuy-ec-website:v7 .

# 启动 docker 镜像
#  docker run -d -p 8080:8080 --name ec-website-v7 yamibuy-ec-website:v7

# 使用数据卷映射方式调试代码
# docker run --rm -d -p 9000:9000/tcp    -v D:\workspace\YAMIBUY\ec\wwwsite\ec-website:/var/www/myapp/   ec-website:latest
